package com.wuchao.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author 吴超66
 * @version 1.0
 * @date 2022/4/20 14:59
 */
@WebServlet(name = "ServletPage",urlPatterns = "/ServletPage")
public class ServletPage extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        PrintWriter out=response.getWriter();
     int current=  Integer.parseInt(request.getParameter("num")) ;
     current+=1;
     request.getRequestDispatcher("demo7/Page.jsp?current="+current).forward(request,response);

        out.flush();
        out.flush();

    }
}
